<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./node_modules/vue/dist/vue.min.js"></script>
</head>
<body>
    <div id="app">
        app
        <hr>
        普通键弹起
        <input type="text" @keyup="jianpanUp">
        <hr>
        回车弹起
        <input type="text" @keyup.13="onEnter">
        <hr>
        <input type="text" @keyup.enter="onEnter">
        <hr>
        <ul>
            <li v-for="el in newsArr" :key="el.title">
                <h2>{{el.title}}</h2>
                <p>作者：{{el.author}}</p>
            </li>
        </ul>
        <hr>
        <ul>
            <li v-for="(el,index) in newsArr" :key="el.title">
                <h2>{{index+1}}. {{el.title}}</h2>
                <p>作者：{{el.author}}</p>
            </li>
        </ul>
    </div>
    <script>
        const app = new Vue({
            el:"#app",
            data:{
                newsArr:[
                    {
                        title:"快放假了！",
                        author:"郑州晚报记者"
                    },
                    {
                        title:"最近要降温！",
                        author:"郑州早报记者"
                    },
                    {
                        title:"台风快登录了，大家做好防范！",
                        author:"沿海日报"
                    }
                ]
            },
            methods:{
                jianpanUp(){
                    console.log("任意键弹起！");
                },
                onEnter(){
                    console.log("按下了回车！");
                }
            }
        })
    </script>
</body>
</html>